﻿//Write a program that reads an array of integers and removes from it a minimal number of elements
//in such way that the remaining array is sorted in increasing order. Print the remaining sorted array. Example:
//	{6, 1, 4, 3, 0, 3, 6, 4, 5}  {1, 3, 3, 4, 5}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _18SortingByRemoving
{
    class Program
    {
        static void Main(string[] args)
        {
            //int[] array = { 6, 1, 4, 3, 0, 3, 6, 4, 5 };
            //List<int> test = new List<int>();
            //List<int> sortedTest = new List<int>();
            //for (int i = 0; i < array.Length; i++)
            //{
            //    test.Add(array[i]);
            //}
            //for (int i = 0; i < array.Length; i++)
            //{
            //    sortedTest.Add(array[i]);
            //}
            //foreach (var item in test)
            //{
            //    Console.Write(item + " ");
            //}
            //for (int i = 0, j = 0; i < test.Count - 1; i++)
            //{
                
            //    if (test[i]>test[i+1])
            //    {
            //        sortedTest.Remove(sortedTest[j]);
            //        j++;
            //    }
            //}
            //Console.WriteLine();
            //foreach (var item in sortedTest)
            //{
            //    Console.Write(item + " ");
            //}
            //Console.WriteLine("\r\n---------------------------------------------------------");  
        }
    }
}
